<%@ page language="java" pageEncoding="ISO-8859-1"%>
<jsp:directive.page import="java.util.ArrayList"/>

<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-template" prefix="template" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-nested" prefix="nested" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html:html locale="true">
  <head>
    <html:base />
    
    <title>addcommpolicestation.jsp</title>

	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
		<script type="text/javascript">
	
	function checkblank(f)
{
  var a=f.noc.value
   b=f.cmpsn.value
   c=f.cmpsh.value
   d=f.T2.value
    
    if((a.match("select")) || (b.length==0) || (c.length==0)||(d.length==0))
   {
      alert("pls fill all d fields")
      if(a.match("select"))
      {
         document.getElementById("lnoc").innerHTML="<font color=green>Select Commissioner's id</font>"
      }
      if(b.length==0)
      {
         document.getElementById("lcmpsn").innerHTML="<font color=green>Enter Commissioner's name </font>"
      }
      if(c.length==0)
      {
         document.getElementById("lcmpsh").innerHTML="<font color=green>Enter Commissioner's headquarter </font>"
      }
      if(d.length==0)
      {
         document.getElementById("led").innerHTML="<font color=green>Enter effect date </font>"
      }
      return false;
    }
  }  
    
    
	
	</script>
<script language="javascript" type="text/javascript" src="datetimepicker_css.js"></script>

	
  <link href="css/style1.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="pink">
<div class="main-out">
<div class="main">
<div class="page">
<div class="top">
<div class="header">
<div class="header-top">
<%@include file="TopHead.jsp" %>
</div>
<div class="topmenu">
<%@include file="TopMenu.jsp" %>
</div>
<div class="">
<img src="images/d3.gif">
</div>
</div>
<div class="content">
<div class="content-left">
<div class="row1">
<div class="img">&nbsp;</div>
<div class="welcome">
<h1 class="title">Welcome to POLICE SEVA<span></span></h1>
<p>




</p>

  <body>
    <html:form action="compsa" onsubmit="return checkblank(this)">
    <div align="center">
    
    <%
    	 ArrayList cid=(ArrayList)request.getAttribute("DIVID");
  		 ArrayList cn=(ArrayList)request.getAttribute("DIVNAME");
  		 Object ob=request.getAttribute("PSIDVALUE");
       Object ob1=request.getAttribute("DATA");
       %>
     
    <table border="0" width="38%">
    <% 
    if(ob1!=null)
    {%>
    <tr>
		
				<td><div align="center">
				<html:select property="noc">
				 <html:option value="select">select Commissionerate Division</html:option>
				 <% 
							if(cid !=null)
					         {
					         
							 	for(int i=0;i<cn.size();i++)
		    	             	{
		    	             			System.out.print(cid.get(i).toString());
		    	             	%>
								<html:option value="<%=cid.get(i).toString()%>"> <%=cn.get(i).toString()%></html:option>
								<%
								} 
							}
							%>
				</html:select></div>
				<br></td>
				<td><br></td>
				<td><label id="lnoc"></label><br></td>
	</tr>
	<tr>
	  <%
     if(ob!=null)
     {
     %>
		<td width="18%">commissioner police station ID</td>
		<td width="20%"><html:text readonly="true" property="cmpsi" value="<%=ob.toString() %>"></html:text> </td>
	</tr>
	<%} %>
	<tr>
		<td width="18%">commissioner police Station Name</td>
		<td width="20%"><html:text property="cmpsn" value=""></html:text></td>
		<td><label id="lcmpsn"></label><br></td>
	</tr>
	<tr>
		<td width="18%">commissioner police Station Headquarter</td>
		<td width="20%"><html:text property="cmpsh" value=""></html:text></td>
		<td><label id="lcmpsh"></label><br></td>
	</tr>
	<tr>
		<td width="18%">Effect Date</td>
		

<td width="76%">
<input type="text" name="T2" id="demo3" size="20" readonly="readonly" onfocus="javascript:NewCssCal('demo3','ddMMMyyyy','arrow')" value="">
</td>
<td><label id="led"></label><br></td>
	</tr>
	
	<tr>
		<td colspan="2"><html:submit property="cmpsp" value="ADDCOMPOLICESTATION"></html:submit> </td>
	</tr>
	
	<tr>

			<td colspan="2"><a href="<%=request.getContextPath()%>/compsa.do?cmpsp=viewcompolicestation">View/Edit</a></td>

		</tr>
	<tr>
	    <td>&nbsp;</td>
		<td><%=ob1.toString() %>  </td>
	</tr>
	<%} 
	else
	{
	%>
	 <tr>
		
				<td><div align="center">
				<html:select property="noc">
				 <html:option value="select">select Commissionerate Division</html:option>
				 <% 
							if(cid !=null)
					         {
					         
							 	for(int i=0;i<cn.size();i++)
		    	             	{
		    	             			System.out.print(cid.get(i).toString());
		    	             	%>
								<html:option value="<%=cid.get(i).toString()%>"> <%=cn.get(i).toString()%></html:option>
								<%
								} 
							}
							%>
				</html:select></div>
				<br></td>
				<td><br></td>
				<td><label id="lnoc"></label><br></td>
	</tr>
	<tr>
	  <%
     if(ob!=null)
     {
     %>
		<td width="18%">commissioner police station ID</td>
		<td width="20%"><html:text readonly="true" property="cmpsi" value="<%=ob.toString() %>"></html:text> </td>
	</tr>
	<%} %>
	<tr>
		<td width="18%">commissioner police Station Name</td>
		<td width="20%"><html:text property="cmpsn"></html:text></td>
		<td><label id="lcmpsn"></label><br></td>
	</tr>
	<tr>
		<td width="18%">commissioner police Station Headquarter</td>
		<td width="20%"><html:text property="cmpsh"></html:text></td>
		<td><label id="lcmpsh"></label><br></td>
	</tr>
	<tr>
		<td width="18%">Effect Date</td>
		

<td width="76%">
<input type="text" name="T2" id="demo3" size="20" readonly="readonly" onfocus="javascript:NewCssCal('demo3','ddMMMyyyy','arrow')">
</td>
<td><label id="led"></label><br></td>
	</tr>
	
	<tr>
		<td colspan="2"><html:submit property="cmpsp" value="ADDCOMPOLICESTATION"></html:submit> </td>
	</tr>
	
	
	
	<tr>

			<td colspan="2"><a href="<%=request.getContextPath()%>/compsa.do?cmpsp=viewcompolicestation">View/Edit</a></td>

		</tr>
	<%} %>
</table>

    
   </div> 
    
    </html:form>



</div>
</div>
</div>
<div class="content-right">
<%@include file="SideMenu.jsp" %>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</div>
</div>
</div>
<div class="bottom">
<!--DO NOT Remove The Footer Links-->
<p><%@include file="Footer.jsp"  %><br>
<!--DO NOT Remove The Footer Links-->
</p>
</div>
</div>
</div>
</div>
</body>
</html:html>
